function [alphac, absbank, signOfBank] = PredGuidanceLoop(statec, statef, signOfBankp, bankProfile)
global Vup Vdown alphamax alphaLD dAziUp dAziDown
rad  = statec(1);
lon = statec(2);
lat = statec(3);
V = statec(4);
azi = statec(6);
lonf = statef(2);
latf = statef(3);
e = 1/rad - V^2/2;
a = bankProfile(1);
b = bankProfile(2);
c = bankProfile(3);
absbank = a*e^2 + b*e + c;
%% AOA
if V > Vup
    alphac = alphamax;
elseif V > Vdown
    alphac = (alphamax - alphaLD)*(V - Vdown)/(Vup - Vdown) + alphaLD;
else
    alphac = alphaLD;
end
%% sign of bank
aziLos = atan(sin(lonf-lon)/(cos(lat)*tan(latf) - sin(lat)*cos(lonf-lon)));
dAzi = azi - aziLos;
if dAzi > dAziUp
    signOfBank = -1;
elseif dAzi > dAziDown
    signOfBank = signOfBankp;
else
    signOfBank = 1;
end
end